﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Simple.Contracts.Contracts;
using Simple.Contracts.Models;
using Simple.Contracts.Models.Common;
using Simple.WebAi.Authorizes;

namespace Simple.WebAi.Controllers
{
    /// <summary>
    /// 仪表盘
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class DashboardController : ControllerBase
    {
        private readonly IDashboardService _dashboardService;
        /// <summary>
        /// 仪表盘
        /// </summary>
        /// <param name="dashboardService"></param>
        public DashboardController(IDashboardService dashboardService)
        {
            _dashboardService = dashboardService;
        }

        /// <summary>
        /// 获取公司仪表盘数据
        /// </summary>
        /// <returns></returns>
        [HttpGet("company-dashboard")]
        [AccountAuthorize]
        public async Task<Result<CompanyDashboardDto>> GetCompanyDashboard()
        {
            return await _dashboardService.GetCompanyDashboard();
        }
    }
}
